package co.fitstart.entity.courseware.fitnessgroup;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author dan
 *
 */
@Alias("batchCoursewareType")
public enum BatchCoursewareType {
	
	WEEKLY("weekly", "每周课件"),
	
	COURSE("course", "课程课件");
	
	private String alias;
	
	private String description;
	
	/**
	 * 
	 * @param alias
	 * @param description
	 */
	BatchCoursewareType(String alias, String description) {
		this.alias = alias;
		this.description = description;
	}
	
	/**
     * 
     * @param alias
     * @return
     */
    public static BatchCoursewareType aliasOf(String alias) {
        for (BatchCoursewareType batchCoursewareType : BatchCoursewareType.values()) {
            if (batchCoursewareType.getAlias().equalsIgnoreCase(alias)) {
                return batchCoursewareType;
            }
        }
        
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isWeekly() {
        return this.equals(WEEKLY);
    }
    
    /**
     * 
     * @return
     */
    public boolean isCourse() {
        return this.equals(COURSE);
    }
	
	/**
	 * @return
	 */
	public String getAlias() {
		return alias;
	}
	
	/**
	 * @return
	 */
	public String getDescription() {
		return description;
	}
}
